﻿using System;
using System.Linq;
using System.Windows.Data;

namespace SoftSource.Timecard.Converters
{
    public sealed class ObjectToManagerListConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var managers = App.Model.ProjectSummaries.Entities
                .Select(p => p.UserSummary)
                .Where(manager => manager.IsActive);
            return managers;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
